import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { BidApplyVO, BidApplyForm, BidApplyQuery } from '@/pagesA/api/workflow/bidApply/types';

/**
 * 查询招标申请列表
 * @param query
 * @returns {*}
 */

export const listBidApply = (query?: BidApplyQuery): AxiosPromise<BidApplyVO[]> => {
  return request({
    url: '/workflow/bidApply/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询招标申请详细
 * @param id
 */
export const getBidApply = (id: string | number): AxiosPromise<BidApplyVO> => {
  return request({
    url: '/workflow/bidApply/' + id,
    method: 'get'
  });
};

/**
 * 新增招标申请
 * @param data
 */
export const addBidApply = (data: BidApplyForm) => {
  return request({
    url: '/workflow/bidApply',
    method: 'post',
    data: data
  });
};

/**
 * 修改招标申请
 * @param data
 */
export const updateBidApply = (data: BidApplyForm) => {
  return request({
    url: '/workflow/bidApply',
    method: 'put',
    data: data
  });
};

/**
 * 删除招标申请
 * @param id
 */
export const delBidApply = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/bidApply/' + id,
    method: 'delete'
  });
};
